<!DOCTYPE html>
<html>
  <head>
    <title>
        <#if type=="1">
            我要投诉
        </#if>
        <#if type=="2">
            我要上报
        </#if>
    </title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" href="${s.base}/mobile/lib/weui.min.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/jquery-weui.css">
    <link rel="stylesheet" href="${s.base}/mobile/css/base.css">
  </head>
  <body>
	<div class="xyg-comp-list-select">
        <input type="hidden"  id="id"  value="${entryFormOne.id}" />
        
        <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title">
                标题
            </div>
            <div class="xyg-comp-list-select-item-content">
                <input type="text" maxlength="50" placeholder="请输入标题" id="name" />
            </div>
        </div>
        <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title">
                手机号
            </div>
            <div class="xyg-comp-list-select-item-content">
                <input type="number" maxlength="12" placeholder="请输入手机号" id="phone" />
            </div>
        </div>
        <div class="xyg-comp-list-select-item">
            <div class="xyg-comp-list-select-item-title">
                地址
            </div>
            <div class="xyg-comp-list-select-item-content">
                <input type="text" maxlength="100" placeholder="请输入地址" id="address" />
            </div>
        </div>
        <div class="xyg-comp-list-textarea-item">
            <div class="xyg-comp-list-textarea-item-title">
                事项内容
            </div>
            <div class="xyg-comp-list-textarea-item-content">
                <textarea class="weui-textarea" placeholder="请输入事项内容，如果没有请填'无'" id="description" rows="3"></textarea>
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <div class="weui-uploader">
                    <div class="weui-uploader__hd">
                        <p class="weui-uploader__title">图片上传</p>
                    </div>
                    <div class="weui-uploader__bd">
                        <ul class="weui-uploader__files" id="uploaderFiles">
                            <!--<li class="weui-uploader__file" style="background-image:url(./images/pic_160.png)"></li>-->
                        </ul>
                        <div class="weui-uploader__input-box">
                            <input id="myFile" name="myfiles" onchange="ajaxFileUploads('myFile','uploaderFiles','upload-avatar')" class="weui-uploader__input" type="file" accept="image/*" multiple="">
                        </div>
                    </div>
                </div>
            </div>
        </div>
  	</div>


   <div class="xyg-bottom">
           <a href="javascript:void(0);" id="submitBtn" class="weui-btn weui-btn_primary backgroud-color">立即提交</a>

    </div>
  <style type="text/css">
      .weui-textarea{ line-height: normal;}
  	.xyg-comp-list-select{width:100%; height:auto;}
	.xyg-comp-list-select-item{width:90%; margin:0px 5%; line-height:2rem; height:2rem;border-bottom:1px solid #F6F6F6;}
	.xyg-comp-list-select-item .xyg-comp-list-select-item-icon{width:70%; line-height:2rem; text-align:right; float:left;}
	.xyg-comp-list-select-item .xyg-comp-list-select-item-title{width:30%;  text-align:left; float:left;}
	.xyg-comp-list-select-item .xyg-comp-list-select-item-content{width:70%;  text-align:left; float:left;}
	.xyg-comp-list-select-item .xyg-comp-list-select-item-content input{width:100%; height:2rem; line-height:2rem; border:0px; text-align:right;}
	.xyg-comp-xy{height:2rem; line-height:2rem; width:width:93%; margin:0px 2% 0px 5%;}
	.xyg-bottom{width:90%; height:auto;  margin:1.5rem 5%;}
    .xyg-comp-list-textarea-item{width:90%; margin:0px 5%; line-height:6rem; height:6rem;border-bottom:1px solid #F6F6F6;}
    .xyg-comp-list-textarea-item .xyg-comp-list-textarea-item-icon{width:70%; line-height:2rem; text-align:right; float:left;}
    .xyg-comp-list-textarea-item .xyg-comp-list-textarea-item-title{width:30%;  text-align:left; float:left;}
    .xyg-comp-list-textarea-item .xyg-comp-list-textarea-item-content{width:70%;  text-align:left; float:left;}
    .xyg-comp-list-textarea-item .xyg-comp-list-textarea-item-content textarea{width:100%; height:6rem; border:0px; line-height: 1.2rem; font-size: 14px;
        text-align:left; color: #4a4f5a;
        font:4;}
  </style>
  </body>
  <script src="${s.base}/mobile/lib/jquery-2.1.4.js"></script>
  <script src="${s.base}/mobile/js/jquery-weui.js"></script>
  <script src="${s.base}/mobile/fonts/iconfont.js"></script>
  <script type="text/javascript" src="${s.base}/js/ajaxfileupload.js?123456"></script>
<script type="text/javascript">

    $("#submitBtn").on("click",function(){
        var name = $("#name").val();
        if(name == null || name == "") {
            $.toast("请输入标题", "text");
            return false;
        }
        var phone = $("#phone").val();
        if(phone == null || phone == "") {
            $.toast("请输入手机号", "text");
            return false;
        }
        var address = $("#address").val();
        if(address == null || address == "") {
            $.toast("请输入地址", "text");
            return false;
        }
        var description = $("#description").val();
        if(description == null || description == "") {
            $.toast("请输入事项内容，如果没有请填'无'", "text");
            return false;
        }
        var pics="";
        $("#uploaderFiles .pic").each(function (index,obj) {
            if(index==0){
                pics+=$(this).attr("data-id");
            }else{
                pics+=","+$(this).attr("data-id");
            }
        })

        var type='${type}';
        var param = {name:name,description:description,address:address,type:type,picture:pics,phone:phone};
        $.showLoading("正在提交中");
        $.post("/phone/submitContent",param,function(result){
            if(1==result.returnInfo.state){
                $.hideLoading();
                if(type=="1"){
                    $.alert("您投诉信息已经提交成功，我们会尽快处理！","温馨提示",function () {
                        window.location.reload();
                    })
                }else if(type=="2"){
                    $.alert("您上报信息已经提交成功，我们会尽快处理！","温馨提示",function () {
                        window.location.reload();
                    })
                }
            }else{
                $.hideLoading();
                $.toast(result.returnInfo.errorMsg, "text");
            }
        },"json");
    });

</script>
  
</html>

